﻿using Mes.Domain.BoundedContext.Entities.WorkOrders;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Mes.Infrastructure.Data.BoundedContext.EntityTypeConfigurations.WorkOrders
{
    public class JobStateEntityConfig : IEntityTypeConfiguration<JobState>
    {
        public void Configure(EntityTypeBuilder<JobState> builder)
        {
            builder.ToTable("job_state");
            builder.Property(b => b.State_Cd).IsRequired();
            builder.HasKey(b => b.State_Cd);
            builder.Property(b => b.State_Desc).HasMaxLength(40).IsRequired();
            builder.Property(b => b.Color).IsRequired();
            builder.Property(b => b.Last_Edit_Comment).HasMaxLength(254).IsRequired();
            builder.Property(b => b.Last_Edit_By).HasMaxLength(40).IsRequired();
            builder.Property(b => b.Last_Edit_At).IsRequired();
        }
    }
}
